home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 2
/
Aminet AMIGA CDROM (1994)(Walnut Creek)[Feb 1994][W.O. 44790-1].iso
/
Aminet
/
util
/
gnu
/
GNU_OLEO_1_2_2.lha
/
oleo-1.2.2
/
parse.tab.c.mine
< prev
next >
Wrap
Text File
|
1993-03-03
|
46KB
|
1,574 lines
#ifndef lint
char yysccsid[] = "@(#)yaccpar 1.5 (Berkeley) 06/03/90";
#endif
#line 2 "parse.y"
/* Copyright (C) 1990, 1992, 1993 Free Software Foundation, Inc.
This file is part of Oleo, the GNU Spreadsheet.
Oleo is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
Oleo is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Oleo; see the file COPYING. If not, write to
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#line 42 "parse.y"
#include "funcdef.h"
#include <ctype.h>
#define obstack_chunk_alloc ck_malloc
#define obstack_chunk_free free
#include "obstack.h"
#include "sysdef.h"
#include "global.h"
#include "errors.h"
#include "node.h"
#include "eval.h"
#include "ref.h"
int yylex ();
#ifdef __STDC__
void yyerror (char *);
#else
void yyerror ();
#endif
VOIDSTAR parse_hash;
extern VOIDSTAR hash_find();
/* This table contains a list of the infix single-char functions */
unsigned char fnin[] = {
SUM, DIFF, DIV, PROD, MOD, /* AND, OR, */ POW, EQUAL, IF, CONCAT, 0
};
#define YYSTYPE _y_y_s_t_y_p_e
typedef struct node *YYSTYPE;
YYSTYPE parse_return;
#ifdef __STDC__
YYSTYPE make_list (YYSTYPE, YYSTYPE);
#else
YYSTYPE make_list ();
#endif
char *instr;
int parse_error = 0;
extern struct obstack tmp_mem;
#line 66 "y.tab.c"
#define NE 257
#define LE 258
#define GE 259
#define NEG 260
#define L_CELL 261
#define L_RANGE 262
#define L_VAR 263
#define L_CONST 264
#define L_FN0 265
#define L_FN1 266
#define L_FN2 267
#define L_FN3 268
#define L_FN4 269
#define L_FNN 270
#define L_FN1R 271
#define L_FN2R 272
#define L_FN3R 273
#define L_FN4R 274
#define L_FNNR 275
#define L_LE 276
#define L_NE 277
#define L_GE 278
#define YYERRCODE 256
short yylhs[] = { -1,
0, 0, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 3, 3,
5, 5, 4, 4, 2, 2,
};
short yylen[] = { 2,
1, 1, 1, 1, 3, 4, 6, 8, 10, 4,
4, 4, 6, 6, 8, 8, 8, 8, 4, 5,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 2, 2, 3, 3, 2, 1, 3,
1, 1, 1, 3, 1, 1,
};
short yydefred[] = { 0,
2, 0, 0, 45, 46, 3, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 4,
34, 35, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 38, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 5, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 41, 0, 0, 43, 37, 36, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 6, 0, 0, 0, 10, 0, 11, 12, 0,
0, 0, 0, 19, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 44, 0, 7, 0, 0, 13,
0, 14, 0, 0, 0, 0, 0, 0, 0, 0,
0, 8, 0, 15, 16, 17, 18, 0, 9,
};
short yydgoto[] = { 18,
63, 20, 55, 64, 65,
};
short yysindex[] = { -33,
0, 208, 208, 0, 0, 0, -36, -30, -22, -14,
-9, -8, -7, -6, -5, -4, 160, 0, 943, 0,
0, 0, 6, 208, 208, 208, 208, 208, -254, -248,
-233, 176, 0, 240, 208, 208, 208, 208, 208, 208,
208, 208, 208, 208, 208, 208, 208, 208, 0, 474,
485, 515, 543, 943, -39, 8, 12, -3, 21, 26,
36, 0, 943, -38, 0, 0, 0, 554, 970, 981,
981, -26, -26, -26, -26, 157, 157, -57, -57, -57,
-57, 0, 208, 208, 208, 0, 208, 0, 0, 208,
208, 208, 208, 0, 176, 208, 581, 608, 619, 943,
315, 447, 647, 674, 0, 943, 0, 208, 208, 0,
208, 0, 208, 208, 208, 715, 743, 781, 808, 847,
874, 0, 208, 0, 0, 0, 0, 901, 0,
};
short yyrindex[] = { 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 92, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, -21, 0, 0, 0, 0, 0, 0,
0, 0, -19, 0, 0, 0, 0, 0, 28, 118,
145, 67, 116, 127, 134, 79, 88, 1, 13, 40,
52, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, -17,
0, 0, 0, 0, 0, 143, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0,
};
short yygindex[] = { 0,
1053, 0, 0, 0, 9,
};
#define YYTABLESIZE 1240
short yytable[] = { 3,
30, 86, 94, 23, 87, 95, 17, 56, 57, 24,
47, 2, 31, 58, 59, 45, 43, 25, 44, 39,
46, 42, 39, 40, 42, 26, 40, 21, 60, 61,
27, 28, 29, 30, 31, 32, 48, 30, 30, 32,
90, 30, 30, 30, 30, 30, 49, 30, 88, 31,
31, 33, 89, 31, 31, 31, 31, 31, 30, 31,
30, 30, 30, 30, 91, 21, 22, 48, 21, 92,
31, 21, 31, 31, 31, 31, 32, 32, 28, 93,
32, 32, 32, 32, 32, 21, 32, 29, 33, 33,
21, 1, 33, 33, 33, 33, 33, 32, 33, 32,
32, 32, 32, 105, 22, 0, 0, 22, 0, 33,
22, 33, 33, 33, 33, 23, 28, 24, 0, 28,
0, 28, 28, 28, 22, 29, 26, 22, 29, 22,
29, 29, 29, 27, 0, 0, 28, 0, 28, 28,
28, 28, 20, 0, 25, 29, 0, 29, 29, 29,
29, 0, 0, 23, 0, 24, 23, 0, 24, 23,
0, 24, 0, 0, 26, 0, 0, 26, 0, 0,
26, 27, 0, 23, 27, 24, 23, 27, 23, 0,
24, 0, 25, 20, 26, 25, 20, 26, 25, 26,
0, 27, 3, 47, 27, 0, 27, 0, 45, 17,
20, 0, 25, 46, 2, 0, 0, 25, 3, 0,
0, 0, 0, 0, 0, 17, 0, 0, 0, 0,
2, 0, 1, 0, 0, 0, 0, 4, 0, 5,
6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
3, 16, 0, 0, 0, 0, 0, 17, 0, 0,
48, 0, 2, 0, 0, 0, 30, 30, 30, 30,
0, 0, 0, 0, 0, 0, 0, 0, 31, 31,
31, 31, 0, 0, 0, 0, 47, 36, 0, 0,
67, 45, 43, 21, 44, 0, 46, 0, 0, 0,
0, 0, 0, 0, 0, 32, 32, 32, 32, 39,
37, 41, 35, 0, 0, 0, 0, 33, 33, 33,
33, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 22, 22, 0, 0, 0, 0, 0, 0,
0, 0, 0, 48, 28, 28, 28, 28, 0, 0,
0, 0, 0, 29, 29, 29, 29, 0, 0, 0,
0, 47, 36, 0, 0, 110, 45, 43, 111, 44,
0, 46, 0, 0, 0, 0, 0, 0, 0, 0,
0, 23, 23, 24, 39, 37, 41, 35, 0, 0,
0, 0, 26, 26, 0, 0, 0, 0, 0, 27,
27, 0, 0, 0, 0, 0, 0, 0, 20, 0,
25, 0, 0, 0, 0, 0, 0, 0, 48, 0,
0, 0, 0, 0, 0, 33, 0, 0, 0, 0,
4, 0, 5, 6, 7, 8, 9, 10, 11, 12,
13, 14, 15, 0, 16, 0, 4, 62, 5, 6,
7, 8, 9, 10, 11, 12, 13, 14, 15, 0,
16, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 4, 0,
5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
15, 0, 16, 47, 36, 0, 0, 112, 45, 43,
113, 44, 0, 46, 0, 66, 38, 40, 42, 0,
0, 0, 0, 0, 0, 0, 39, 37, 41, 35,
47, 36, 0, 0, 82, 45, 43, 0, 44, 0,
46, 47, 36, 0, 0, 0, 45, 43, 83, 44,
0, 46, 0, 39, 37, 41, 35, 0, 0, 0,
48, 0, 0, 0, 39, 37, 41, 35, 0, 0,
0, 47, 36, 0, 0, 0, 45, 43, 84, 44,
0, 46, 0, 0, 0, 0, 0, 48, 0, 0,
0, 38, 40, 42, 39, 37, 41, 35, 48, 47,
36, 0, 0, 0, 45, 43, 85, 44, 0, 46,
47, 36, 0, 0, 0, 45, 43, 0, 44, 0,
46, 0, 39, 37, 41, 35, 0, 0, 48, 0,
0, 96, 0, 39, 37, 41, 35, 47, 36, 0,
0, 107, 45, 43, 0, 44, 0, 46, 0, 0,
0, 0, 0, 0, 0, 0, 48, 0, 0, 0,
39, 37, 41, 35, 47, 36, 0, 48, 0, 45,
43, 108, 44, 0, 46, 47, 36, 0, 0, 0,
45, 43, 109, 44, 0, 46, 0, 39, 37, 41,
35, 0, 0, 0, 48, 0, 0, 0, 39, 37,
41, 35, 0, 47, 36, 0, 0, 0, 45, 43,
114, 44, 0, 46, 0, 0, 0, 0, 0, 0,
0, 48, 0, 38, 40, 42, 39, 37, 41, 35,
47, 36, 48, 0, 0, 45, 43, 115, 44, 0,
46, 0, 0, 0, 0, 0, 0, 0, 0, 0,
38, 40, 42, 39, 37, 41, 35, 0, 0, 0,
48, 38, 40, 42, 0, 0, 0, 0, 0, 0,
0, 47, 36, 0, 0, 122, 45, 43, 0, 44,
0, 46, 0, 0, 0, 0, 0, 48, 0, 0,
0, 38, 40, 42, 39, 37, 41, 35, 0, 47,
36, 0, 0, 0, 45, 43, 123, 44, 0, 46,
0, 0, 0, 0, 0, 0, 0, 0, 0, 38,
40, 42, 39, 37, 41, 35, 0, 0, 48, 0,
38, 40, 42, 0, 0, 0, 0, 47, 36, 0,
0, 124, 45, 43, 0, 44, 0, 46, 0, 0,
0, 0, 0, 0, 0, 0, 48, 38, 40, 42,
39, 37, 41, 35, 47, 36, 0, 0, 125, 45,
43, 0, 44, 0, 46, 0, 0, 0, 0, 0,
0, 0, 0, 0, 38, 40, 42, 39, 37, 41,
35, 0, 0, 0, 48, 38, 40, 42, 0, 0,
0, 0, 0, 47, 36, 0, 0, 126, 45, 43,
0, 44, 0, 46, 0, 0, 0, 0, 0, 0,
0, 48, 0, 38, 40, 42, 39, 37, 41, 35,
47, 36, 0, 0, 127, 45, 43, 0, 44, 0,
46, 0, 0, 0, 0, 0, 0, 0, 0, 0,
38, 40, 42, 39, 37, 41, 35, 47, 36, 0,
48, 129, 45, 43, 0, 44, 0, 46, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
39, 37, 41, 35, 0, 0, 0, 48, 0, 0,
0, 38, 40, 42, 0, 0, 0, 0, 0, 47,
36, 0, 0, 0, 45, 43, 0, 44, 0, 46,
0, 0, 0, 0, 48, 0, 0, 0, 0, 38,
40, 42, 39, 37, 41, 35, 47, 0, 0, 0,
0, 45, 43, 0, 44, 0, 46, 47, 0, 0,
0, 0, 45, 43, 0, 44, 0, 46, 0, 39,
37, 41, 0, 0, 0, 0, 48, 38, 40, 42,
39, 0, 41, 0, 0, 0, 0, 0, 0, 0,
0, 0, 19, 0, 21, 22, 0, 0, 0, 0,
0, 0, 0, 48, 38, 40, 42, 0, 0, 34,
0, 0, 0, 0, 48, 0, 50, 51, 52, 53,
54, 0, 0, 0, 0, 0, 0, 68, 69, 70,
71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
81, 0, 0, 38, 40, 42, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
38, 40, 42, 0, 0, 97, 98, 99, 0, 100,
0, 0, 101, 102, 103, 104, 0, 0, 106, 0,
0, 0, 0, 0, 0, 0, 0, 38, 40, 42,
116, 117, 0, 118, 0, 119, 120, 121, 0, 0,
0, 0, 0, 0, 0, 128, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 38,
40, 42, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 38, 40, 42, 0,
0, 0, 0, 0, 0, 0, 0, 0, 40, 42,
};
short yycheck[] = { 33,
0, 41, 41, 40, 44, 44, 40, 262, 263, 40,
37, 45, 0, 262, 263, 42, 43, 40, 45, 41,
47, 41, 44, 41, 44, 40, 44, 0, 262, 263,
40, 40, 40, 40, 40, 40, 94, 37, 38, 0,
44, 41, 42, 43, 44, 45, 41, 47, 41, 37,
38, 0, 41, 41, 42, 43, 44, 45, 58, 47,
60, 61, 62, 63, 44, 38, 0, 94, 41, 44,
58, 44, 60, 61, 62, 63, 37, 38, 0, 44,
41, 42, 43, 44, 45, 58, 47, 0, 37, 38,
63, 0, 41, 42, 43, 44, 45, 58, 47, 60,
61, 62, 63, 95, 38, -1, -1, 41, -1, 58,
44, 60, 61, 62, 63, 0, 38, 0, -1, 41,
-1, 43, 44, 45, 58, 38, 0, 61, 41, 63,
43, 44, 45, 0, -1, -1, 58, -1, 60, 61,
62, 63, 0, -1, 0, 58, -1, 60, 61, 62,
63, -1, -1, 38, -1, 38, 41, -1, 41, 44,
-1, 44, -1, -1, 38, -1, -1, 41, -1, -1,
44, 38, -1, 58, 41, 58, 61, 44, 63, -1,
63, -1, 38, 41, 58, 41, 44, 61, 44, 63,
-1, 58, 33, 37, 61, -1, 63, -1, 42, 40,
58, -1, 58, 47, 45, -1, -1, 63, 33, -1,
-1, -1, -1, -1, -1, 40, -1, -1, -1, -1,
45, -1, 256, -1, -1, -1, -1, 261, -1, 263,
264, 265, 266, 267, 268, 269, 270, 271, 272, 273,
33, 275, -1, -1, -1, -1, -1, 40, -1, -1,
94, -1, 45, -1, -1, -1, 256, 257, 258, 259,
-1, -1, -1, -1, -1, -1, -1, -1, 256, 257,
258, 259, -1, -1, -1, -1, 37, 38, -1, -1,
41, 42, 43, 256, 45, -1, 47, -1, -1, -1,
-1, -1, -1, -1, -1, 256, 257, 258, 259, 60,
61, 62, 63, -1, -1, -1, -1, 256, 257, 258,
259, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, 256, 257, -1, -1, -1, -1, -1, -1,
-1, -1, -1, 94, 256, 257, 258, 259, -1, -1,
-1, -1, -1, 256, 257, 258, 259, -1, -1, -1,
-1, 37, 38, -1, -1, 41, 42, 43, 44, 45,
-1, 47, -1, -1, -1, -1, -1, -1, -1, -1,
-1, 256, 257, 256, 60, 61, 62, 63, -1, -1,
-1, -1, 256, 257, -1, -1, -1, -1, -1, 256,
257, -1, -1, -1, -1, -1, -1, -1, 256, -1,
256, -1, -1, -1, -1, -1, -1, -1, 94, -1,
-1, -1, -1, -1, -1, 256, -1, -1, -1, -1,
261, -1, 263, 264, 265, 266, 267, 268, 269, 270,
271, 272, 273, -1, 275, -1, 261, 262, 263, 264,
265, 266, 267, 268, 269, 270, 271, 272, 273, -1,
275, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, 261, -1,
263, 264, 265, 266, 267, 268, 269, 270, 271, 272,
273, -1, 275, 37, 38, -1, -1, 41, 42, 43,
44, 45, -1, 47, -1, 256, 257, 258, 259, -1,
-1, -1, -1, -1, -1, -1, 60, 61, 62, 63,
37, 38, -1, -1, 41, 42, 43, -1, 45, -1,
47, 37, 38, -1, -1, -1, 42, 43, 44, 45,
-1, 47, -1, 60, 61, 62, 63, -1, -1, -1,
94, -1, -1, -1, 60, 61, 62, 63, -1, -1,
-1, 37, 38, -1, -1, -1, 42, 43, 44, 45,
-1, 47, -1, -1, -1, -1, -1, 94, -1, -1,
-1, 257, 258, 259, 60, 61, 62, 63, 94, 37,
38, -1, -1, -1, 42, 43, 44, 45, -1, 47,
37, 38, -1, -1, -1, 42, 43, -1, 45, -1,
47, -1, 60, 61, 62, 63, -1, -1, 94, -1,
-1, 58, -1, 60, 61, 62, 63, 37, 38, -1,
-1, 41, 42, 43, -1, 45, -1, 47, -1, -1,
-1, -1, -1, -1, -1, -1, 94, -1, -1, -1,
60, 61, 62, 63, 37, 38, -1, 94, -1, 42,
43, 44, 45, -1, 47, 37, 38, -1, -1, -1,
42, 43, 44, 45, -1, 47, -1, 60, 61, 62,
63, -1, -1, -1, 94, -1, -1, -1, 60, 61,
62, 63, -1, 37, 38, -1, -1, -1, 42, 43,
44, 45, -1, 47, -1, -1, -1, -1, -1, -1,
-1, 94, -1, 257, 258, 259, 60, 61, 62, 63,
37, 38, 94, -1, -1, 42, 43, 44, 45, -1,
47, -1, -1, -1, -1, -1, -1, -1, -1, -1,
257, 258, 259, 60, 61, 62, 63, -1, -1, -1,
94, 257, 258, 259, -1, -1, -1, -1, -1, -1,
-1, 37, 38, -1, -1, 41, 42, 43, -1, 45,
-1, 47, -1, -1, -1, -1, -1, 94, -1, -1,
-1, 257, 258, 259, 60, 61, 62, 63, -1, 37,
38, -1, -1, -1, 42, 43, 44, 45, -1, 47,
-1, -1, -1, -1, -1, -1, -1, -1, -1, 257,
258, 259, 60, 61, 62, 63, -1, -1, 94, -1,
257, 258, 259, -1, -1, -1, -1, 37, 38, -1,
-1, 41, 42, 43, -1, 45, -1, 47, -1, -1,
-1, -1, -1, -1, -1, -1, 94, 257, 258, 259,
60, 61, 62, 63, 37, 38, -1, -1, 41, 42,
43, -1, 45, -1, 47, -1, -1, -1, -1, -1,
-1, -1, -1, -1, 257, 258, 259, 60, 61, 62,
63, -1, -1, -1, 94, 257, 258, 259, -1, -1,
-1, -1, -1, 37, 38, -1, -1, 41, 42, 43,
-1, 45, -1, 47, -1, -1, -1, -1, -1, -1,
-1, 94, -1, 257, 258, 259, 60, 61, 62, 63,
37, 38, -1, -1, 41, 42, 43, -1, 45, -1,
47, -1, -1, -1, -1, -1, -1, -1, -1, -1,
257, 258, 259, 60, 61, 62, 63, 37, 38, -1,
94, 41, 42, 43, -1, 45, -1, 47, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
60, 61, 62, 63, -1, -1, -1, 94, -1, -1,
-1, 257, 258, 259, -1, -1, -1, -1, -1, 37,
38, -1, -1, -1, 42, 43, -1, 45, -1, 47,
-1, -1, -1, -1, 94, -1, -1, -1, -1, 257,
258, 259, 60, 61, 62, 63, 37, -1, -1, -1,
-1, 42, 43, -1, 45, -1, 47, 37, -1, -1,
-1, -1, 42, 43, -1, 45, -1, 47, -1, 60,
61, 62, -1, -1, -1, -1, 94, 257, 258, 259,
60, -1, 62, -1, -1, -1, -1, -1, -1, -1,
-1, -1, 0, -1, 2, 3, -1, -1, -1, -1,
-1, -1, -1, 94, 257, 258, 259, -1, -1, 17,
-1, -1, -1, -1, 94, -1, 24, 25, 26, 27,
28, -1, -1, -1, -1, -1, -1, 35, 36, 37,
38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
48, -1, -1, 257, 258, 259, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
257, 258, 259, -1, -1, 83, 84, 85, -1, 87,
-1, -1, 90, 91, 92, 93, -1, -1, 96, -1,
-1, -1, -1, -1, -1, -1, -1, 257, 258, 259,
108, 109, -1, 111, -1, 113, 114, 115, -1, -1,
-1, -1, -1, -1, -1, 123, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, 257,
258, 259, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, 257, 258, 259, -1,
-1, -1, -1, -1, -1, -1, -1, -1, 258, 259,
};
#define YYFINAL 18
#ifndef YYDEBUG
#define YYDEBUG 0
#endif
#define YYMAXTOKEN 278
#if YYDEBUG
char *yyname[] = {
"end-of-file",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
"'!'",0,0,0,"'%'","'&'",0,"'('","')'","'*'","'+'","','","'-'",0,"'/'",0,0,0,0,0,
0,0,0,0,0,"':'",0,"'<'","'='","'>'","'?'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,"'^'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"NE","LE","GE","NEG","L_CELL","L_RANGE","L_VAR",
"L_CONST","L_FN0","L_FN1","L_FN2","L_FN3","L_FN4","L_FNN","L_FN1R","L_FN2R",
"L_FN3R","L_FN4R","L_FNNR","L_LE","L_NE","L_GE",
};
char *yyrule[] = {
"$accept : line",
"line : exp",
"line : error",
"exp : L_CONST",
"exp : cell",
"exp : L_FN0 '(' ')'",
"exp : L_FN1 '(' exp ')'",
"exp : L_FN2 '(' exp ',' exp ')'",
"exp : L_FN3 '(' exp ',' exp ',' exp ')'",
"exp : L_FN4 '(' exp ',' exp ',' exp ',' exp ')'",
"exp : L_FNN '(' exp_list ')'",
"exp : L_FN1R '(' L_RANGE ')'",
"exp : L_FN1R '(' L_VAR ')'",
"exp : L_FN2R '(' L_RANGE ',' exp ')'",
"exp : L_FN2R '(' L_VAR ',' exp ')'",
"exp : L_FN2R '(' L_RANGE ',' exp ',' exp ')'",
"exp : L_FN2R '(' L_VAR ',' exp ',' exp ')'",
"exp : L_FN3R '(' L_RANGE ',' exp ',' exp ')'",
"exp : L_FN3R '(' L_VAR ',' exp ',' exp ')'",
"exp : L_FNNR '(' range_exp_list ')'",
"exp : exp '?' exp ':' exp",
"exp : exp '&' exp",
"exp : exp '<' exp",
"exp : exp LE exp",
"exp : exp '=' exp",
"exp : exp NE exp",
"exp : exp '>' exp",
"exp : exp GE exp",
"exp : exp '+' exp",
"exp : exp '-' exp",
"exp : exp '*' exp",
"exp : exp '/' exp",
"exp : exp '%' exp",
"exp : exp '^' exp",
"exp : '-' exp",
"exp : '!' exp",
"exp : '(' exp ')'",
"exp : '(' exp error",
"exp : '(' error",
"exp_list : exp",
"exp_list : exp_list ',' exp",
"range_exp : L_RANGE",
"range_exp : exp",
"range_exp_list : range_exp",
"range_exp_list : range_exp_list ',' range_exp",
"cell : L_CELL",
"cell : L_VAR",
};
#endif
#ifndef YYSTYPE
typedef int YYSTYPE;
#endif
#define yyclearin (yychar=(-1))
#define yyerrok (yyerrflag=0)
#ifndef YYSTACKSIZE
#ifdef YYMAXDEPTH
#define YYSTACKSIZE YYMAXDEPTH
#else
#define YYSTACKSIZE 300
#endif
#endif
int yydebug;
int yynerrs;
int yyerrflag;
int yychar;
short *yyssp;
YYSTYPE *yyvsp;
YYSTYPE yyval;
YYSTYPE yylval;
#define yystacksize YYSTACKSIZE
short yyss[YYSTACKSIZE];
YYSTYPE yyvs[YYSTACKSIZE];
#line 283 "parse.y"
void
yyerror FUN1(char *, s)
{
if(!parse_error)
parse_error=PARSE_ERR;
}
YYSTYPE
make_list FUN2(YYSTYPE, car, YYSTYPE, cdr)
{
YYSTYPE ret;
ret=(YYSTYPE)obstack_alloc(&tmp_mem,sizeof(*ret));
ret->comp_value = 0;
ret->n_x.v_subs[0]=car;
ret->n_x.v_subs[1]=cdr;
return ret;
}
#define ERROR -1
extern struct node *yylval;
#ifdef __STDC__
unsigned char parse_cell_or_range (char **,struct rng *);
int str_to_col (char ** str);
#else
unsigned char parse_cell_or_range ();
#endif
int
yylex FUN0()
{
int ch;
struct node *new;
int isflt;
char *begin;
char *tmp_str;
unsigned char byte_value;
int n;
/* unsigned char *ptr; */
int nn;
struct function *fp;
int tmp_ch;
#ifdef TEST
if(!instr)
return ERROR;
#endif
while(isspace(*instr))
instr++;
ch = *instr++;
if(ch=='(' || ch==',' || ch==')')
return ch;
new=(struct node *)obstack_alloc(&tmp_mem,sizeof(struct node));
new->add_byte=0;
new->sub_value=0;
switch(ch) {
case 0:
return 0;
case '0': case '1': case '2': case '3': case '4': case '5': case '6':
case '7': case '8': case '9': case '.':
isflt = (ch=='.');
begin=instr-1;
tmp_str=instr;
while(isdigit(*tmp_str) || (!isflt && *tmp_str=='.' && ++isflt))
tmp_str++;
if(*tmp_str=='e' || *tmp_str=='E') {
isflt=1;
tmp_str++;
if(*tmp_str=='-' || *tmp_str=='+')
tmp_str++;
while(isdigit(*tmp_str))
tmp_str++;
}
if(isflt) {
new->n_x.v_float=astof((char **)(&begin));
byte_value=CONST_FLT;
} else {
new->n_x.v_int=astol((char **)(&begin));
if(begin!=tmp_str) {
begin=instr-1;
new->n_x.v_float=astof((char **)(&begin));
byte_value=CONST_FLT;
} else
byte_value=CONST_INT;
}
ch=L_CONST;
instr=begin;
break;
case '"':
begin=instr;
while(*instr && *instr!='"') {
if(*instr=='\\' && instr[1])
instr++;
instr++;
}
if(!*instr) {
parse_error=NO_QUOTE;
return ERROR;
}
tmp_str=new->n_x.v_string=(char *)ck_malloc(1+instr-begin);
while(begin!=instr) {
unsigned char n;
if(*begin=='\\') {
begin++;
if(begin[0]>='0' && begin[0]<='7') {
if(begin[1]>='0' && begin[1]<='7') {
if(begin[2]>='0' && begin[2]<='7') {
n=(begin[2]-'0') + (010 * (begin[1]-'0')) + ( 0100 * (begin[0]-'0'));
begin+=3;
} else {
n=(begin[1]-'0') + (010 * (begin[0]-'0'));
begin+=2;
}
} else {
n=begin[0]-'0';
begin++;
}
} else
n= *begin++;
*tmp_str++= n;
} else
*tmp_str++= *begin++;
}
*tmp_str='\0';
instr++;
byte_value=CONST_STR;
ch=L_CONST;
break;
case '+': case '-':
case '*': case '/': case '%': case '&':
/* case '|': */ case '^': case '=':
case '?':
{
unsigned char *ptr;
for(ptr= fnin;*ptr;ptr++)
if(the_funs[*ptr].fn_str[0]==ch)
break;
#ifdef TEST
if(!*ptr)
panic("Can't find fnin[] entry for '%c'",ch);
#endif
byte_value= *ptr;
}
break;
case ':':
byte_value=IF;
break;
case '!':
case '<':
case '>':
if(*instr!='=') {
byte_value = (ch=='<') ? LESS : (ch=='>') ? GREATER : NOT;
break;
}
instr++;
byte_value = (ch=='<') ? LESSEQ : (ch=='>') ? GREATEQ : NOTEQUAL;
ch = (ch=='<') ? LE : (ch=='>') ? GE : NE;
break;
case '\'':
case ';':
case '[':
case '\\':
case ']':
case '`':
case '{':
case '}':
case '~':
bad_chr:
parse_error=BAD_CHAR;
return ERROR;
case '#':
begin=instr-1;
while(*instr && (isalnum(*instr) || *instr=='_'))
instr++;
ch= *instr;
*instr=0;
if(!stricmp(begin,tname))
byte_value=F_TRUE;
else if(!stricmp(begin,fname))
byte_value=F_FALSE;
else if(!stricmp(begin,iname) && (begin[4]==0 || !stricmp(begin+4,"inity")))
byte_value=CONST_INF;
else if(!stricmp(begin,mname) ||
!stricmp(begin,"#ninf"))
byte_value=CONST_NINF;
else if(!stricmp(begin,nname) ||
!stricmp(begin,"#nan"))
byte_value=CONST_NAN;
else {
for(n=1;n<=ERR_MAX;n++)
if(!stricmp(begin,ename[n]))
break;
if(n>ERR_MAX)
n=BAD_CHAR;
new->n_x.v_int=n;
byte_value=CONST_ERR;
}
*instr=ch;
ch=L_CONST;
break;
default:
if(!a0 && (ch=='@' || ch=='$'))
goto bad_chr;
if(a0 && ch=='@') {
begin=instr;
while(*instr && (isalpha(*instr) || isdigit(*instr) || *instr=='_'))
instr++;
n=instr-begin;
} else {
begin=instr-1;
byte_value=parse_cell_or_range(&begin,&(new->n_x.v_rng));
if(byte_value) {
if((byte_value& ~0x3)==R_CELL)
ch=L_CELL;
else
ch=L_RANGE;
instr=begin;
break;
}
while(*instr && (isalpha(*instr) || isdigit(*instr) || *instr=='_'))
instr++;
n=instr-begin;
while(isspace(*instr))
instr++;
if(*instr!='(') {
ch=L_VAR;
byte_value=VAR;
new->n_x.v_var=find_or_make_var(begin,n);
break;
}
}
tmp_ch=begin[n];
begin[n]='\0';
fp=hash_find(parse_hash,begin);
begin[n]=tmp_ch;
byte_value= ERROR;
if(!fp) {
parse_error=BAD_FUNC;
return ERROR;
}
if(fp>=the_funs && fp<=&the_funs[USR1])
byte_value=fp-the_funs;
else {
for(nn=0;nn<n_usr_funs;nn++) {
if(fp>=&usr_funs[nn][0] && fp<=&usr_funs[nn][usr_n_funs[nn]]) {
byte_value=USR1+nn;
new->sub_value=fp-&usr_funs[nn][0];
break;
}
}
#ifdef TEST
if(nn==n_usr_funs) {
io_error_msg("Couln't turn fp into a ##");
parse_error=BAD_FUNC;
return ERROR;
}
#endif
}
if(fp->fn_argn&X_J)
ch= byte_value==F_IF ? L_FN3 : L_FN2;
else if(fp->fn_argt[0]=='R' || fp->fn_argt[0]=='E')
ch=L_FN1R-1+fp->fn_argn-X_A0;
else
ch=L_FN0 + fp->fn_argn-X_A0;
break;
}
/* new->node_type=ch; */
new->comp_value=byte_value;
yylval=new;
return ch;
}
/* Return value is
0 if it doesn't look like a cell or a range,
R_CELL if it is a cell (ptr now points past the characters, lr and lc hold the row and col of the cell)
RANGE if it is a range (ptr points past the chars)
*/
unsigned char
parse_cell_or_range FUN2(char **,ptr, struct rng *,retp)
{
if(a0) {
unsigned tmpc,tmpr;
char *p;
int abz = ROWREL|COLREL;
p= *ptr;
tmpc=0;
if(*p=='$') {
abz-=COLREL;
p++;
}
if(!isalpha(*p))
return 0;
tmpc=str_to_col(&p);
if(tmpc<MIN_COL || tmpc>MAX_COL)
return 0;
if(*p=='$') {
abz-=ROWREL;
p++;
}
if(!isdigit(*p))
return 0;
for(tmpr=0;isdigit(*p);p++)
tmpr=tmpr*10 + *p - '0';
if(tmpr<MIN_ROW || tmpr>MAX_ROW)
return 0;
if(*p==':' || *p=='.') {
unsigned tmpc1,tmpr1;
abz = ((abz&COLREL) ? LCREL : 0)|((abz&ROWREL) ? LRREL : 0)|HRREL|HCREL;
p++;
if(*p=='$') {
abz-=HCREL;
p++;
}
if(!isalpha(*p))
return 0;
tmpc1=str_to_col(&p);
if(tmpc1<MIN_COL || tmpc1>MAX_COL)
return 0;
if(*p=='$') {
abz-=HRREL;
p++;
}
if(!isdigit(*p))
return 0;
for(tmpr1=0;isdigit(*p);p++)
tmpr1=tmpr1*10 + *p - '0';
if(tmpr1<MIN_ROW || tmpr1>MAX_ROW)
return 0;
if(tmpr<tmpr1) {
retp->lr=tmpr;
retp->hr=tmpr1;
} else {
retp->lr=tmpr1;
retp->hr=tmpr;
}
if(tmpc<tmpc1) {
retp->lc=tmpc;
retp->hc=tmpc1;
} else {
retp->lc=tmpc1;
retp->hc=tmpc;
}
*ptr= p;
return RANGE | abz;
}
retp->lr = retp->hr = tmpr;
retp->lc = retp->hc = tmpc;
*ptr=p;
return R_CELL | abz;
} else {
char *p;
unsigned char retr;
unsigned char retc;
int ended;
long num;
CELLREF tmp;
#define CK_ABS_R(x) ((x)<MIN_ROW || (x)>MAX_ROW)
#define CK_REL_R(x) (((x)>0 && MAX_ROW-(x)<cur_row) \
|| ((x)<0 && MIN_ROW-(x)>cur_row))
#define CK_ABS_C(x) ((x)<MIN_COL || (x)>MAX_COL)
#define CK_REL_C(x) (((x)>0 && MAX_COL-(x)<cur_col) \
|| ((x)<0 && MIN_COL-(x)>cur_col))
#define MAYBEREL(p) (*(p)=='[' && (isdigit((p)[1]) || (((p)[1]=='+' || (p)[1]=='-') && isdigit((p)[2]))))
p= *ptr;
retr=0;
retc=0;
ended=0;
while(ended==0) {
switch(*p) {
case 'r':
case 'R':
if(retr) {
ended++;
break;
}
p++;
retr=R_CELL;
if(isdigit(*p)) {
num=astol(&p);
if (CK_ABS_R(num))
return 0;
retp->lr= retp->hr=num;
} else if(MAYBEREL(p)) {
p++;
num=astol(&p);
if (CK_REL_R(num))
return 0;
retp->lr= retp->hr=num+cur_row;
retr|=ROWREL;
if(*p==':') {
retr=RANGE|LRREL|HRREL;
p++;
num=astol(&p);
if (CK_REL_R(num))
return 0;
retp->hr=num+cur_row;
}
if(*p++!=']')
return 0;
} else if(retc || *p=='c' || *p=='C') {
retr|=ROWREL;
retp->lr= retp->hr=cur_row;
} else
return 0;
if(*p==':' && retr!=(RANGE|LRREL|HRREL)) {
retr= (retr&ROWREL) ? RANGE|LRREL : RANGE;
p++;
if(isdigit(*p)) {
num=astol(&p);
if (CK_ABS_R(num))
return 0;
retp->hr=num;
} else if(MAYBEREL(p)) {
p++;
num=astol(&p);
if (CK_REL_R(num))
return 0;
retp->hr=num+cur_row;
retr|=HRREL;
if(*p++!=']')
return 0;
} else
return 0;
}
if(retc)
ended++;
break;
case 'c':
case 'C':
if(retc) {
ended++;
break;
}
p++;
retc=R_CELL;
if(isdigit(*p)) {
num=astol(&p);
if (CK_ABS_C(num))
return 0;
retp->lc= retp->hc=num;
} else if(MAYBEREL(p)) {
p++;
num=astol(&p);
if (CK_REL_C(num))
return 0;
retp->lc= retp->hc=num+cur_col;
retc|=COLREL;
if(*p==':') {
retc=RANGE|LCREL|HCREL;
p++;
num=astol(&p);
if (CK_REL_C(num))
return 0;
retp->hc=num+cur_col;
}
if(*p++!=']')
return 0;
} else if(retr || *p=='r' || *p=='R') {
retc|=COLREL;
retp->lc= retp->hc=cur_col;
} else
return 0;
if(*p==':' && retc!=(RANGE|LCREL|HCREL)) {
retc= (retc&COLREL) ? RANGE|LCREL : RANGE;
p++;
if(isdigit(*p)) {
num=astol(&p);
if (CK_ABS_C(num))
return 0;
retp->hc=num;
} else if(MAYBEREL(p)) {
p++;
num=astol(&p);
if (CK_REL_C(num))
return 0;
retp->hc=num+cur_col;
retc|=HCREL;
if(*p++!=']')
return 0;
} else
return 0;
}
if(retr)
ended++;
break;
default:
if(retr) {
*ptr=p;
retp->lc=MIN_COL;
retp->hc=MAX_COL;
if((retr|ROWREL)==(R_CELL|ROWREL))
return (retr&ROWREL) ? (RANGE|LRREL|HRREL) : RANGE;
else
return retr;
} else if(retc) {
*ptr=p;
retp->lr=MIN_ROW;
retp->hr=MAX_COL;
if((retc|COLREL)==(R_CELL|COLREL))
return (retc&COLREL) ? (RANGE|LCREL|HCREL) : RANGE;
else
return retc;
}
return 0;
}
}
if(!retr || !retc)
return 0;
*ptr=p;
if(retp->lr>retp->hr)
tmp=retp->lr,retp->lr=retp->hr,retp->hr=tmp;
if(retp->lc>retp->hc)
tmp=retp->lc,retp->lc=retp->hc,retp->hc=tmp;
if((retr|ROWREL)==(R_CELL|ROWREL)) {
if((retc|COLREL)==(R_CELL|COLREL))
return retr|retc;
return (retr&ROWREL) ? (retc|LRREL|HRREL) : retc;
}
if((retc|COLREL)==(R_CELL|COLREL))
return (retc&COLREL) ? (retr|LCREL|HCREL) : retr;
return retr|retc;
}
}
int
str_to_col FUN1(char **,str)
{
int ret;
char c,cc,ccc;
#if MAX_COL>702
char cccc;
#endif
ret=0;
c=str[0][0];
if(!isalpha((cc=str[0][1]))) {
(*str)++;
return MIN_COL + (isupper(c) ? c-'A' : c-'a');
}
if(!isalpha((ccc=str[0][2]))) {
(*str)+=2;
return MIN_COL+26 + (isupper(c) ? c-'A' : c-'a')*26 + (isupper(cc) ? cc-'A' : cc-'a');
}
#if MAX_COL>702
if(!isalpha((cccc=str[0][3]))) {
(*str)+=3;
return MIN_COL+702 + (isupper(c) ? c-'A' : c-'a')*26*26 + (isupper(cc) ? cc-'A' : cc-'a')*26 + (isupper(ccc) ? ccc-'A' : ccc-'a');
}
if(!isalpha(str[0][4])) {
(*str)+=4;
return MIN_COL+18278 + (isupper(c) ? c-'A' : c-'a')*26*26*26 + (isupper(cc) ? cc-'A' : cc-'a')*26*26 + (isupper(ccc) ? ccc-'A' : ccc-'a')*26 + (isupper(cccc) ? cccc-'A' : cccc-'a');
}
#endif
return 0;
}
#line 1096 "y.tab.c"
#define YYABORT goto yyabort
#define YYACCEPT goto yyaccept
#define YYERROR goto yyerrlab
int
yyparse()
{
register int yym, yyn, yystate;
#if YYDEBUG
register char *yys;
extern char *getenv();
if (yys = getenv("YYDEBUG"))
{
yyn = *yys;
if (yyn >= '0' && yyn <= '9')
yydebug = yyn - '0';
}
#endif
yynerrs = 0;
yyerrflag = 0;
yychar = (-1);
yyssp = yyss;
yyvsp = yyvs;
*yyssp = yystate = 0;
yyloop:
if (yyn = yydefred[yystate]) goto yyreduce;
if (yychar < 0)
{
if ((yychar = yylex()) < 0) yychar = 0;
#if YYDEBUG
if (yydebug)
{
yys = 0;
if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
if (!yys) yys = "illegal-symbol";
printf("yydebug: state %d, reading %d (%s)\n", yystate,
yychar, yys);
}
#endif
}
if ((yyn = yysindex[yystate]) && (yyn += yychar) >= 0 &&
yyn <= YYTABLESIZE && yycheck[yyn] == yychar)
{
#if YYDEBUG
if (yydebug)
printf("yydebug: state %d, shifting to state %d\n",
yystate, yytable[yyn]);
#endif
if (yyssp >= yyss + yystacksize - 1)
{
goto yyoverflow;
}
*++yyssp = yystate = yytable[yyn];
*++yyvsp = yylval;
yychar = (-1);
if (yyerrflag > 0) --yyerrflag;
goto yyloop;
}
if ((yyn = yyrindex[yystate]) && (yyn += yychar) >= 0 &&
yyn <= YYTABLESIZE && yycheck[yyn] == yychar)
{
yyn = yytable[yyn];
goto yyreduce;
}
if (yyerrflag) goto yyinrecovery;
#ifdef lint
goto yynewerror;
#endif
yynewerror:
yyerror("syntax error");
#ifdef lint
goto yyerrlab;
#endif
yyerrlab:
++yynerrs;
yyinrecovery:
if (yyerrflag < 3)
{
yyerrflag = 3;
for (;;)
{
if ((yyn = yysindex[*yyssp]) && (yyn += YYERRCODE) >= 0 &&
yyn <= YYTABLESIZE && yycheck[yyn] == YYERRCODE)
{
#if YYDEBUG
if (yydebug)
printf("yydebug: state %d, error recovery shifting\
to state %d\n", *yyssp, yytable[yyn]);
#endif
if (yyssp >= yyss + yystacksize - 1)
{
goto yyoverflow;
}
*++yyssp = yystate = yytable[yyn];
*++yyvsp = yylval;
goto yyloop;
}
else
{
#if YYDEBUG
if (yydebug)
printf("yydebug: error recovery discarding state %d\n",
*yyssp);
#endif
if (yyssp <= yyss) goto yyabort;
--yyssp;
--yyvsp;
}
}
}
else
{
if (yychar == 0) goto yyabort;
#if YYDEBUG
if (yydebug)
{
yys = 0;
if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
if (!yys) yys = "illegal-symbol";
printf("yydebug: state %d, error recovery discards token %d (%s)\n",
yystate, yychar, yys);
}
#endif
yychar = (-1);
goto yyloop;
}
yyreduce:
#if YYDEBUG
if (yydebug)
printf("yydebug: state %d, reducing by rule %d (%s)\n",
yystate, yyn, yyrule[yyn]);
#endif
yym = yylen[yyn];
yyval = yyvsp[1-yym];
switch (yyn)
{
case 1:
#line 87 "parse.y"
{ parse_return=yyvsp[0]; }
break;
case 2:
#line 88 "parse.y"
{
if(!parse_error)
parse_error=PARSE_ERR;
parse_return=0; }
break;
case 5:
#line 96 "parse.y"
{
yyval=yyvsp[-2]; }
break;
case 6:
#line 98 "parse.y"
{
(yyvsp[-3])->n_x.v_subs[0]=yyvsp[-1];
(yyvsp[-3])->n_x.v_subs[1]=(struct node *)0;
yyval=yyvsp[-3]; }
break;
case 7:
#line 102 "parse.y"
{
(yyvsp[-5])->n_x.v_subs[0]=yyvsp[-3];
(yyvsp[-5])->n_x.v_subs[1]=yyvsp[-1];
yyval=yyvsp[-5]; }
break;
case 8:
#line 106 "parse.y"
{
(yyvsp[-7])->n_x.v_subs[0]=make_list(yyvsp[-5],yyvsp[-3]);
(yyvsp[-7])->n_x.v_subs[1]=yyvsp[-1];
yyval=yyvsp[-7];}
break;
case 9:
#line 110 "parse.y"
{
(yyvsp[-9])->n_x.v_subs[0]=make_list(yyvsp[-7],yyvsp[-5]);
(yyvsp[-9])->n_x.v_subs[1]=make_list(yyvsp[-3],yyvsp[-1]);
yyval=yyvsp[-9];}
break;
case 10:
#line 114 "parse.y"
{
(yyvsp[-3])->n_x.v_subs[0]=(struct node *)0;
(yyvsp[-3])->n_x.v_subs[1]=yyvsp[-1];
yyval=yyvsp[-3]; }
break;
case 11:
#line 118 "parse.y"
{
yyvsp[-3]->n_x.v_subs[0]=yyvsp[-1];
yyval=yyvsp[-3]; }
break;
case 12:
#line 121 "parse.y"
{
yyvsp[-3]->n_x.v_subs[0]=yyvsp[-1];
yyval=yyvsp[-3]; }
break;
case 13:
#line 125 "parse.y"
{
yyvsp[-5]->n_x.v_subs[0]=yyvsp[-3];
yyvsp[-5]->n_x.v_subs[1]=yyvsp[-1];
yyval=yyvsp[-5]; }
break;
case 14:
#line 129 "parse.y"
{
yyvsp[-5]->n_x.v_subs[0]=yyvsp[-3];
yyvsp[-5]->n_x.v_subs[1]=yyvsp[-1];
yyval=yyvsp[-5]; }
break;
case 15:
#line 135 "parse.y"
{
if(yyvsp[-7]->comp_value!=F_INDEX)
parse_error=PARSE_ERR;
yyvsp[-7]->comp_value=F_INDEX2;
yyvsp[-7]->n_x.v_subs[0]=make_list(yyvsp[-5],yyvsp[-3]);
yyvsp[-7]->n_x.v_subs[1]=yyvsp[-1];
yyval=yyvsp[-7]; }
break;
case 16:
#line 142 "parse.y"
{
if(yyvsp[-7]->comp_value!=F_INDEX)
parse_error=PARSE_ERR;
yyvsp[-7]->comp_value=F_INDEX2;
yyvsp[-7]->n_x.v_subs[0]=make_list(yyvsp[-5],yyvsp[-3]);
yyvsp[-7]->n_x.v_subs[1]=yyvsp[-1];
yyval=yyvsp[-7]; }
break;
case 17:
#line 150 "parse.y"
{
(yyvsp[-7])->n_x.v_subs[0]=make_list(yyvsp[-5],yyvsp[-3]);
(yyvsp[-7])->n_x.v_subs[1]=yyvsp[-1];
yyval=yyvsp[-7];}
break;
case 18:
#line 154 "parse.y"
{
(yyvsp[-7])->n_x.v_subs[0]=make_list(yyvsp[-5],yyvsp[-3]);
(yyvsp[-7])->n_x.v_subs[1]=yyvsp[-1];
yyval=yyvsp[-7];}
break;
case 19:
#line 159 "parse.y"
{
(yyvsp[-3])->n_x.v_subs[0]=(struct node *)0;
(yyvsp[-3])->n_x.v_subs[1]=yyvsp[-1];
yyval=yyvsp[-3]; }
break;
case 20:
#line 163 "parse.y"
{
yyvsp[-3]->comp_value=IF;
yyvsp[-3]->n_x.v_subs[0]=yyvsp[-1];
yyvsp[-3]->n_x.v_subs[1]=yyvsp[0];
yyvsp[-1]->n_x.v_subs[0]=yyvsp[-4];
yyvsp[-1]->n_x.v_subs[1]=yyvsp[-2];
yyval=yyvsp[-3]; }
break;
case 21:
#line 174 "parse.y"
{
yyvsp[-1]->n_x.v_subs[0]=yyvsp[-2];
yyvsp[-1]->n_x.v_subs[1]=yyvsp[0];
yyval = yyvsp[-1]; }
break;
case 22:
#line 178 "parse.y"
{
yyvsp[-1]->n_x.v_subs[0]=yyvsp[-2];
yyvsp[-1]->n_x.v_subs[1]=yyvsp[0];
yyval = yyvsp[-1]; }
break;
case 23:
#line 182 "parse.y"
{
yyvsp[-1]->n_x.v_subs[0]=yyvsp[-2];
yyvsp[-1]->n_x.v_subs[1]=yyvsp[0];
yyval = yyvsp[-1]; }
break;
case 24:
#line 186 "parse.y"
{
yyvsp[-1]->n_x.v_subs[0]=yyvsp[-2];
yyvsp[-1]->n_x.v_subs[1]=yyvsp[0];
yyval = yyvsp[-1]; }
break;
case 25:
#line 190 "parse.y"
{
yyvsp[-1]->n_x.v_subs[0]=yyvsp[-2];
yyvsp[-1]->n_x.v_subs[1]=yyvsp[0];
yyval = yyvsp[-1]; }
break;
case 26:
#line 194 "parse.y"
{
yyvsp[-1]->n_x.v_subs[0]=yyvsp[-2];
yyvsp[-1]->n_x.v_subs[1]=yyvsp[0];
yyval = yyvsp[-1]; }
break;
case 27:
#line 198 "parse.y"
{
yyvsp[-1]->n_x.v_subs[0]=yyvsp[-2];
yyvsp[-1]->n_x.v_subs[1]=yyvsp[0];
yyval = yyvsp[-1]; }
break;
case 28:
#line 202 "parse.y"
{
yyvsp[-1]->n_x.v_subs[0]=yyvsp[-2];
yyvsp[-1]->n_x.v_subs[1]=yyvsp[0];
yyval = yyvsp[-1]; }
break;
case 29:
#line 206 "parse.y"
{
yyvsp[-1]->n_x.v_subs[0]=yyvsp[-2];
yyvsp[-1]->n_x.v_subs[1]=yyvsp[0];
yyval = yyvsp[-1]; }
break;
case 30:
#line 210 "parse.y"
{
yyvsp[-1]->n_x.v_subs[0]=yyvsp[-2];
yyvsp[-1]->n_x.v_subs[1]=yyvsp[0];
yyval = yyvsp[-1]; }
break;
case 31:
#line 214 "parse.y"
{
yyvsp[-1]->n_x.v_subs[0]=yyvsp[-2];
yyvsp[-1]->n_x.v_subs[1]=yyvsp[0];
yyval = yyvsp[-1]; }
break;
case 32:
#line 218 "parse.y"
{
yyvsp[-1]->n_x.v_subs[0]=yyvsp[-2];
yyvsp[-1]->n_x.v_subs[1]=yyvsp[0];
yyval = yyvsp[-1]; }
break;
case 33:
#line 222 "parse.y"
{
yyvsp[-1]->n_x.v_subs[0]=yyvsp[-2];
yyvsp[-1]->n_x.v_subs[1]=yyvsp[0];
yyval = yyvsp[-1]; }
break;
case 34:
#line 226 "parse.y"
{
if(yyvsp[0]->comp_value==CONST_FLT) {
yyvsp[0]->n_x.v_float= -(yyvsp[0]->n_x.v_float);
/* free($1); */
yyval=yyvsp[0];
} else if(yyvsp[0]->comp_value==CONST_INT) {
yyvsp[0]->n_x.v_int= -(yyvsp[0]->n_x.v_int);
/* free($1); */
yyval=yyvsp[0];
} else {
yyvsp[-1]->comp_value = NEGATE;
yyvsp[-1]->n_x.v_subs[0]=yyvsp[0];
yyvsp[-1]->n_x.v_subs[1]=(struct node *)0;
yyval = yyvsp[-1];
} }
break;
case 35:
#line 241 "parse.y"
{
yyvsp[-1]->n_x.v_subs[0]=yyvsp[0];
yyvsp[-1]->n_x.v_subs[1]=(struct node *)0;
yyval = yyvsp[-1]; }
break;
case 36:
#line 246 "parse.y"
{ yyval = yyvsp[-1]; }
break;
case 37:
#line 247 "parse.y"
{
if(!parse_error)
parse_error=NO_CLOSE;
}
break;
case 38:
#line 255 "parse.y"
{
if(!parse_error)
parse_error=NO_CLOSE;
}
break;
case 39:
#line 263 "parse.y"
{ yyval = make_list(yyvsp[0], 0); }
break;
case 40:
#line 265 "parse.y"
{ yyval = make_list(yyvsp[0], yyvsp[-2]); }
break;
case 43:
#line 273 "parse.y"
{ yyval=make_list(yyvsp[0], 0); }
break;
case 44:
#line 275 "parse.y"
{ yyval=make_list(yyvsp[0],yyvsp[-2]); }
break;
case 45:
#line 279 "parse.y"
{ yyval=yyvsp[0]; }
break;
#line 1518 "y.tab.c"
}
yyssp -= yym;
yystate = *yyssp;
yyvsp -= yym;
yym = yylhs[yyn];
if (yystate == 0 && yym == 0)
{
#if YYDEBUG
if (yydebug)
printf("yydebug: after reduction, shifting from state 0 to\
state %d\n", YYFINAL);
#endif
yystate = YYFINAL;
*++yyssp = YYFINAL;
*++yyvsp = yyval;
if (yychar < 0)
{
if ((yychar = yylex()) < 0) yychar = 0;
#if YYDEBUG
if (yydebug)
{
yys = 0;
if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
if (!yys) yys = "illegal-symbol";
printf("yydebug: state %d, reading %d (%s)\n",
YYFINAL, yychar, yys);
}
#endif
}
if (yychar == 0) goto yyaccept;
goto yyloop;
}
if ((yyn = yygindex[yym]) && (yyn += yystate) >= 0 &&
yyn <= YYTABLESIZE && yycheck[yyn] == yystate)
yystate = yytable[yyn];
else
yystate = yydgoto[yym];
#if YYDEBUG
if (yydebug)
printf("yydebug: after reduction, shifting from state %d \
to state %d\n", *yyssp, yystate);
#endif
if (yyssp >= yyss + yystacksize - 1)
{
goto yyoverflow;
}
*++yyssp = yystate;
*++yyvsp = yyval;
goto yyloop;
yyoverflow:
yyerror("yacc stack overflow");
yyabort:
return (1);
yyaccept:
return (0);
}